package com.bwie.controller;

import com.bwie.common.domain.Region;
import com.bwie.common.domain.Store;
import com.bwie.common.domain.request.StoreRequest;
import com.bwie.common.result.PageResult;
import com.bwie.common.result.Result;
import com.bwie.service.StoreService;
import net.bytebuddy.agent.builder.AgentBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @className: StoreController
 * @Description: TODO
 * @version: v1.８.0
 * @author: 刘茂锴
 * @date: 2025/10/13 13:53
 */
@RestController
@RequestMapping("/store")
@CrossOrigin
public class StoreController {
    @Autowired
    private StoreService storeService;
    //门店列表
    @PostMapping("/list")
    public Result<PageResult<Store>> storeList(@RequestBody StoreRequest storeRequest){
        PageResult<Store> list=storeService.storeList(storeRequest);
        return Result.success(list);
    }

    //门店区域下拉框
    @GetMapping("/regionList")
    public Result regionList(){
        List<Region> regionList=storeService.regionList();
        return Result.success(regionList);
    }
}
